#### Start of system configuration section. ####

srcdir =	@srcdir@

ifeq ($(srcdir),.)
srcdir = ../../..
endif

VPATH :=	$(srcdir)

# Common prefix for machine-independent installed files.
prefix =	@prefix@

# Common prefix for machine-dependent installed files.
exec_prefix =	@exec_prefix@

bindir =	$(exec_prefix)/bin
libdir =	$(exec_prefix)/Sys/libs

INSTALL =	@INSTALL@
INSTALL_DATA =	@INSTALL_DATA@

CC =		@CC@

CFLAGS =	@CFLAGS@
LDFLAGS =	@LDFLAGS@

RANLIB =	@RANLIB@
AR =		ar

#### End system configuration section ####

FLAVOR_CFLAGS =	-m$(CPU) -m$(FPU) -f$(BASE)
OTHER_CFLAGS =	-fomit-frame-pointer
ALL_CFLAGS =	$(CFLAGS) $(FLAVOR_CFLAGS) $(OTHER_CFLAGS) $(INCS)

INCS =		-I$(srcdir) -I$(srcdir)/../library -I$(srcdir)/../include
LIB =		libstack.a

.c.o:
		$(CC) $(ALL_CFLAGS) -c $< -o $@

SRC=		init_stk.c link_a5_0_f.c link_a5_d0_f.c stk_argbytes.c \
		stk_minframe.c stk_safezone.c stkchk_d0.c stkext.c stkovf.c \
		stkrst.c stkrst_f.c sub_d0_sp.c xcovf.c

OBJ =		$(SRC:.c=.o)

$(LIB):		$(OBJ)
		rm -f $@
		$(AR) rc $@ $(OBJ)
		$(RANLIB) $@

clean:
		rm -rf *baserel

clobber:	clean
		rm -f Makefile
